import java.util.Arrays;
import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();

        int[] tem = new int[6];
        int[] s = new int[3];
        while (n-- != 0) {
            for (int i = 0; i < 6; i++) {
                tem[i] = in.nextInt();
            }
            Arrays.sort(tem);
            int[] c = new int[3];
            if(isT(tem,s) == 1){
                System.out.println("Yes");
            }
            else
            System.out.println("No");
        }
    }
    private static int isT(int[] tem,int[] c){
        //三层for循环
        for (int i = 0; i < 4; i++) {
            for (int j = i+1; j < 5; j++) {
                for (int k = j+1; k < 6; k++) {
                    if(tem[i] + tem[j] > tem[k]){
                        int t = 0;
                        for (int m = 0; m < 6; m++) {
                            if (m != i && m != j && m != k)
                                c[t++] = tem[m];
                        }
                       if(c[0] + c[1] > c[2]) return 1;
                    }
                }
            }
        }
        return -1;
    }

    //错误逻辑
    public static void main2(String[] args) {
            Scanner in = new Scanner(System.in);
            int n = in.nextInt();

            int[] tem = new int[6];
            int[] s = new int[3];
            while (n-- != 0) {
                for (int i = 0; i < 6; i++) {
                    tem[i] = in.nextInt();
                }
                Arrays.sort(tem);

                boolean flat = false;
                for (int i = 0; i < 4; i++) {
                    int left = i + 1, right = 5;
                    while (left < right) {
                        if (tem[i] + tem[left] > tem[right]) {
                            int k = 0;
                            for (int j = 0; j < 6; j++) {
                                if (j != i && j != left && j != right)
                                    s[k++] = tem[j];
                            }
                            if (tem[0] + tem[1] > tem[2]) {
                                System.out.println("Yes");
                                flat = true;
                                break;
                            } else left++;
                        } else if (tem[i] + tem[left] < tem[right]) {
                            left++;
                        } else right--;
                    }
                    if(flat) break;
                }
                if(!flat) System.out.println("No");
            }
        }


    public static void main1(String[] args) {

        Scanner in = new Scanner(System.in);
        String str = in.nextLine();

        //滑动窗口
        int left = 0,right = 0,begin = 0,len = 1;
        for(;right < str.length();right++){

            //1.进入窗口 r++

            //2.判断
            if(!(str.charAt(right) >= '0' && str.charAt(right) <= '9')){
               //出窗口操作
                int r = right - left + 1;
                while(r-- != 0) left++;
            }

            //3.更新
            if(len < right - left + 1){
                len = right - left + 1;
                begin = left;
            }
        }

        System.out.println(str.substring(begin,begin + len));
    }
}
class Solution {

    int[] dx = {0,0,1,-1};
    int[] dy = {1,-1,0,0};
    boolean[][] flat;

    public int solve (char[][] grid) {
        int n = grid.length;
        int m = grid[0].length;
        flat = new boolean[n][m];

        //递归dps函数
        int num = 0;
        for(int i = 0;i < n;i++){
            for(int j = 0;j < m;j++){
                if(grid[i][j] == '1' && !flat[i][j]){
                    int ret = dps(grid,i,j,n,m);
                    if(ret >= 1) num++;
                }

            }
        }
        return num;
    }

    //dps函数的实现
    public int dps(char[][] grid,int i,int j,int n,int m){

        int count = 1;
        flat[i][j] = true;
        for(int k = 0;k < 4;k++){
            int x = i + dx[k];
            int y = j + dy[k];

            if(x >= 0 && x < n && y >= 0 && y < m && !flat[x][y] && grid[x][y] == '1'){
                count += dps(grid,x,y,n,m);
            }
        }

        return count;
    }

    public static void main(String[] args) {
        Solution solution = new Solution();
        char[][] grid = {{'1','1','0','0','0'},{'0','1',0,'1','1'},{0,0,0,'1','1'},{0,0,0,0,0}};
        System.out.println(solution.solve(grid));
        Arrays.sort(grid);
    }
}